// pages/anchors/anchors.js
Page({
  data: {
    navRouter:[],

    bannerInfo:{
      imgSrc:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1523938753680&di=f8ef87e3070fd21a9ca56305c72a05d9&imgtype=0&src=http%3A%2F%2Fimg.18183.com%2Fuploads%2Fallimg%2F171205%2F114-1G2051K352.jpg',
      msg:'游戏陪练随时待命'
    },

    anchorsList:[
      {
        name: '鞠静祎',
        feature: '超级王牌',
        age:18,
        gender:0,
        time: 20,
        voiceTime: 8,
        price:20,
        voiceIcon:'https://bpic.588ku.com/element_pic/00/99/66/5256f3834bb7913.jpg!/fw/254/quality/90/unsharp/true/compress/true',
        genderSrc: 'https://bpic.588ku.com/element_pic/17/12/15/13b4972f963b5ffeb46693fc9f0fc4b1.jpg!/fw/254/quality/90/unsharp/true/compress/true',
        imgSrc: 'http://img95.699pic.com/photo/50001/8888.jpg_wh860.jpg',
        audioSrc: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
      },
      {
        name: '鞠静祎',
        feature:'超级王牌',
        time: 20,
        age: 18,
        gender: 0,
        voiceTime: 9,
        price: 20,   
        voiceIcon: 'https://bpic.588ku.com/element_pic/00/99/66/5256f3834bb7913.jpg!/fw/254/quality/90/unsharp/true/compress/true',genderSrc:'https://bpic.588ku.com/element_pic/17/12/15/13b4972f963b5ffeb46693fc9f0fc4b1.jpg!/fw/254/quality/90/unsharp/true/compress/true',
        imgSrc: 'http://img95.699pic.com/photo/50001/8888.jpg_wh860.jpg',
        audioSrc: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
      },
      {
        name: '鞠静祎',
        feature: '超级王牌',
        time: 20,
        age: 18,
        gender: 0,
        voiceTime: 9,
        price: 20,
        voiceIcon: 'https://bpic.588ku.com/element_pic/00/99/66/5256f3834bb7913.jpg!/fw/254/quality/90/unsharp/true/compress/true', genderSrc: 'https://bpic.588ku.com/element_pic/17/12/15/13b4972f963b5ffeb46693fc9f0fc4b1.jpg!/fw/254/quality/90/unsharp/true/compress/true',
        imgSrc: 'http://img95.699pic.com/photo/50001/8888.jpg_wh860.jpg',
        audioSrc: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
      },
      {
        name: '鞠静祎',
        feature: '超级王牌',
        time: 20,
        age: 18,
        gender: 0,
        voiceTime: 9,
        price: 20,
        voiceIcon: 'https://bpic.588ku.com/element_pic/00/99/66/5256f3834bb7913.jpg!/fw/254/quality/90/unsharp/true/compress/true', genderSrc: 'https://bpic.588ku.com/element_pic/17/12/15/13b4972f963b5ffeb46693fc9f0fc4b1.jpg!/fw/254/quality/90/unsharp/true/compress/true',
        imgSrc: 'http://img95.699pic.com/photo/50001/8888.jpg_wh860.jpg',
        audioSrc: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
      },
      {
        name: '鞠静祎',
        feature: '超级王牌',
        time: 20,
        age: 18,
        gender: 0,
        voiceTime: 9,
        price: 20,
        voiceIcon: 'https://bpic.588ku.com/element_pic/00/99/66/5256f3834bb7913.jpg!/fw/254/quality/90/unsharp/true/compress/true', genderSrc: 'https://bpic.588ku.com/element_pic/17/12/15/13b4972f963b5ffeb46693fc9f0fc4b1.jpg!/fw/254/quality/90/unsharp/true/compress/true',
        imgSrc: 'http://img95.699pic.com/photo/50001/8888.jpg_wh860.jpg',
        audioSrc: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
      },
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //根据类型展示不同数据 目前只有游戏跟情感
    let type = options.type;
    if(type==='game'){
      this.setData({
        navRouter: [{isSelect: true,name: '绝地求生'},
                  {isSelect: false, name: '王者荣耀'},]
      })
      wx.setNavigationBarTitle({
        title: "游戏陪练"
      })
    }else{
      this.setData({
        navRouter: [{ isSelect: true, name: '情绪发泄' },
        { isSelect: false, name: '情感咨询' },]
      })
      wx.setNavigationBarTitle({
        title: "情感陪伴"
      })
    }
  },

  chengName(e){
    let index = e.target.dataset.index;
    let navRouter = this.data.navRouter;
    navRouter.forEach((item,ind)=>{
      item.isSelect= ind === index ? true:false;
    })
    this.setData({ navRouter});
  },

  toDetail(e){
    let id = e.target.dataset.id;
    wx.navigateTo({
      url: `../skillDetail/skillDetail?id=${id}`,
      success: function () {
      },
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})